package CelestialDataAccess;

import java.util.UUID;

public class OrderItem {

    public UUID m_uidOrderItemID;
    public String m_strProductID;
    public int m_iQuantity;
    public double m_dblUnitPrice;
    public boolean m_bPriceOverride;
    public String m_strRemarks;

    /*************************************************************************/
    /* Get / Set methods */
    public double getExtendedPrice(){ return m_dblUnitPrice * m_iQuantity;}
    /*************************************************************************/
    /* Constructors */
    OrderItem(){}
    /*-----------------------------------------------------------------------*/
    OrderItem(Product prod, int qty){
        m_uidOrderItemID = UUID.randomUUID();
        m_strProductID = prod.getProductID();
        m_iQuantity = qty;
        m_dblUnitPrice = prod.getPrice();
        m_bPriceOverride = false;
    }
    /*-----------------------------------------------------------------------*/
    OrderItem(Product prod, int qty, double price){
        m_uidOrderItemID = UUID.randomUUID();
        m_strProductID = prod.getProductID();
        m_iQuantity = qty;
        m_dblUnitPrice = price;
        m_bPriceOverride = true;
    }
    /*-----------------------------------------------------------------------*/
}

